package logic

import (
	"context"
	"fmt"
	"shop_srv/model/redisinit"

	"shop_srv/internal/svc"
	"shop_srv/shop"

	"github.com/zeromicro/go-zero/core/logx"
)

type CheckCartLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewCheckCartLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CheckCartLogic {
	return &CheckCartLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

// 查询购物车是否为空
func (l *CheckCartLogic) CheckCart(in *shop.CheckCartRequest) (*shop.CheckCartResponse, error) {
	// todo: add your logic here and delete this line

	cart := redisinit.CheckCart(in.UserId, in.ShopId)
	fmt.Println(cart)
	return &shop.CheckCartResponse{}, nil
}
